//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.jeeplus.common.web;

import com.baidu.ueditor.ActionEnter;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

public abstract class UeditorBaseController {
    public UeditorBaseController() {
    }

    @RequestMapping(
        method = {RequestMethod.GET}
    )
    public void get(HttpServletRequest request, HttpServletResponse response) throws IOException {
        this.doAction(request, response);
    }

    @RequestMapping(
        method = {RequestMethod.POST}
    )
    public void post(HttpServletRequest request, HttpServletResponse response) throws IOException {
        this.doAction(request, response);
    }

    protected abstract String getRootPath();

    protected abstract String getConfigPath();

    private void doAction(HttpServletRequest request, HttpServletResponse response) throws IOException {
        PrintWriter out = response.getWriter();
        response.setHeader("Content-Type", "text/html");
        out.write((new ActionEnter(request, this.getRootPath())).exec());
    }
}
